package me.zingon;

import freemarker.template.TemplateException;
import me.zingon.db.TableDao;
import me.zingon.service.*;
import me.zingon.service.impl.*;
import me.zingon.util.Maps;
import me.zingon.util.MyUtil;
import org.apache.log4j.Logger;

import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) throws IOException, TemplateException, ParseException {
        Logger logger= Logger.getLogger("");
        TableDao td=new TableDao();
        td.loadTables();
        logger.info("数据库加载完成");
        ModelService ms=new ModelServiceImpl();
        DaoService ds=new DaoServiceImpl();
        ServiceService ss=new ServiceServiceImpl();
        ControllerService cs=new ControllerServiceImpl();
        FrontService fs=new FrontServiceImpl();
//        List<String> tables = Maps.getTables();
//        for (String table : tables) {
//            ms.createModel(table);
//            ds.createDao(table);
//            ds.createMapper(table);
//            ss.createService(table);
//            ss.createServiceImpl(table);
//            cs.createController(table);
//        }
//
        ms.createModels();
        ds.createDaos();
        ds.createMappers();
        ss.createServices();
        ss.createServiceImpls();
        cs.createControllers();
        fs.createJss();
        fs.createJsps();
    }
}
